Optimize Unity applications on Android using Neon intrinsics
Introduction
Set up
Arm Neon and the Unity Burst compiler
The sample project
The plain (unoptimized) code
The optimizations
Collecting performance data
Analyzing the performance data
Profiling best practice
Summary
Appendix
Next Steps
Optimize Unity applications on Android using Neon intrinsics
Who is this for?
Developers interested in leveraging the Unity Machine Learning Agents toolkit on Arm devices.
What will you learn?
Upon completion of this Learning Path, you will be able to:
- Use Arm Neon intrinsics in your Unity C# scripts
- Optimize your code
- Collect and compare performance data using the Unity Profiler and Analyzer tools
Prerequisites
Before starting, you will need the following:
- Basic knowledge of Unity and C#
- Recent Android device, such as a mobile phone or tablet
- Desktop computer capable of running Unity
- Unity version compatible with Unity Burst compiler 1.5 or later
Summary
This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
You’ll optimize Unity collision detection for Android by comparing Plain, Burst, and hand-written Arm Neon implementations. First, you’ll set up Unity and the collision sample, review character-wall and character-character detection, and apply Burst and Neon changes. You’ll build and profile each mode on your Android device, then use Unity Profile Analyzer to compare the captured data and follow profiling practices.
Frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Open
Assets/BurstNeonCollisions/Scripts/CollisionCalculationScript.cs and change line 66 to public const Mode codeMode = Mode.Plain; to select the unoptimized mode for your initial measurements.From Window, select Packet Management > Package Manager. Set Packages to Unity Registry, search for Burst, select it, and select Install if it’s not already ticked.
To match the environment used in the Learning Path, use Unity v6.3 and Burst 1.8.28.
Review the character-wall and character-character collision functions. In Plain mode,
DoWallsPlain() loops through all characters and walls, while DoCharactersPlain() checks each character against the others; the code assumes a character can hit up to two walls.Burst can auto-vectorize your code efficiently, so hand-written Neon doesn’t always improve performance. Profile your app before and after adding Neon. If performance doesn’t improve, Burst might produce better-optimized code.